package ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.acceptRFCPanel.acceptRFCPanelSubs;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.net.URL;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.acceptRFCPanel.AcceptRFCPanel;
import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.acceptRFCPanel.acceptRFCPanelSubs.listeners.ActaliseListsButtonListener;
import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.acceptRFCPanel.acceptRFCPanelSubs.listeners.OpenRFCButtonListener;

public class AcceptRFCFunctionpanel extends JPanel{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private AcceptRFCPanel acceptRFCPanel;
	private JButton bu_actualise, bu_oppenRFC;
	private JLabel progress;
	
	public AcceptRFCFunctionpanel(AcceptRFCPanel acceptRFCPanel){
		
		this.acceptRFCPanel  = acceptRFCPanel;
		this.setLayout(new BorderLayout());
		this.setPreferredSize(new Dimension(250, 400));
		
		URL pic = getClass().getResource("/progressbar_cont.gif");
		this.progress = new JLabel(new ImageIcon(pic));
		this.progress.setVisible(false);
		
		this.bu_actualise = new JButton("Aktualisieren");
		this.bu_actualise.addActionListener(new ActaliseListsButtonListener(acceptRFCPanel));
		
		this.bu_oppenRFC = new JButton("RFC annehmen/beenden");
		this.bu_oppenRFC.addActionListener(new OpenRFCButtonListener(acceptRFCPanel));
		
		this.add(new Buttonlist(), BorderLayout.NORTH);
	}
	
	public AcceptRFCPanel getAcceptRFCPanel() {
		return acceptRFCPanel;
	}

	public JButton getBu_actualise() {
		return bu_actualise;
	}

	public JButton getBu_acceptRFC() {
		return bu_oppenRFC;
	}

	public JLabel getProgress() {
		return progress;
	}

	private class Buttonlist extends JPanel{
		
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		private Buttonlist(){
			setLayout(new GridLayout(3, 1));
			
			this.add(bu_actualise);
			this.add(bu_oppenRFC);
			this.add(progress);
		}
	}

}
